const errorHandle = (ctx, next) => {
    return next().catch((err) => {
        if (err.status === 401) {
            ctx.status = 401;
            ctx.body = {
                code: 0,
                data: {},
                msg: '您尚未登录请登录后再试！'
            };
        } else {
            // throw err;
        }
    });
}

module.exports = errorHandle